﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JLM2
{
    public class Utils
    {
        public static void WriteLog(string ClassName, string Content)
        {
            try
            {
                if (!Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "\\Log\\"))
                {
                    Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory + "\\Log\\");
                }
                string logPath = AppDomain.CurrentDomain.BaseDirectory + "\\Log\\Log_" + DateTime.Now.ToString("yyyy-MM-dd") + ".Log";
                using (System.IO.StreamWriter sw = System.IO.File.AppendText(logPath))
                {
                    sw.WriteLine(ClassName + DateTime.Now.ToString("【yyyy-MM-dd HH:mm:ss】: ") + Content);
                    sw.Close();
                }
            }
            catch { }
        }
    }
}